package com.yzt.base.dto;

import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("ZTree 树形结构封装类")
public class ZTreeDTO {

    @ApiModelProperty(value = "节点ID")
    private Long id;

    @ApiModelProperty(value = "节点名字")
    private String name;

    @ApiModelProperty(value = "节点自定义图标样式")
    private String iconSkin;

    @ApiModelProperty(value = "链接地址")
    private String url;

    @ApiModelProperty(value = "链接打开方式")
    private String target;

    @ApiModelProperty(value = "是否选中")
    private boolean checked = false;

    @ApiModelProperty(value = "是否展开")
    private boolean open = false;

    @ApiModelProperty(value = "是否是父节点")
    private boolean isParent = false;

    @ApiModelProperty(value = "子节点列表")
    private List<ZTreeDTO> children;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIconSkin() {
        return iconSkin;
    }

    public void setIconSkin(String iconSkin) {
        this.iconSkin = iconSkin;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }

    public boolean getIsParent() {
        if (this.children != null && this.children.size() > 0) {
            return true;
        } else {
            return false;
        }
    }

    public void setIsParent(boolean isParent) {
        this.isParent = isParent;
    }

    public List<ZTreeDTO> getChildren() {
        if (this.children != null && this.children.size() > 0)
            return children;
        return null;
    }

    public void setChildren(List<ZTreeDTO> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "ZTreeDTO [id=" + id + ", name=" + name + ", iconSkin=" + iconSkin + ", url=" + url + ", target="
                + target + ", checked=" + checked + ", open=" + open + ", isParent=" + isParent + ", children="
                + children + "]";
    }

}
